package com.chee.plant.hibernate.object.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the external_user table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="external_user"
 */

public abstract class BaseExternalUser  implements Serializable {

	public static String REF = "ExternalUser";
	public static String PROP_NICK_NAME = "NickName";
	public static String PROP_TYPE = "Type";
	public static String PROP_ID = "Id";
	public static String PROP_USER_NAME = "UserName";
	public static String PROP_USER_ID = "UserId";


	// constructors
	public BaseExternalUser () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseExternalUser (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseExternalUser (
		java.lang.Integer id,
		java.lang.Integer type,
		java.lang.String userName,
		java.lang.String nickName,
		java.lang.Integer userId) {

		this.setId(id);
		this.setType(type);
		this.setUserName(userName);
		this.setNickName(nickName);
		this.setUserId(userId);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.Integer type;
	private java.lang.String userName;
	private java.lang.String nickName;
	private java.lang.Integer userId;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="sequence"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: type
	 */
	public java.lang.Integer getType () {
		return type;
	}

	/**
	 * Set the value related to the column: type
	 * @param type the type value
	 */
	public void setType (java.lang.Integer type) {
		this.type = type;
	}



	/**
	 * Return the value associated with the column: user_name
	 */
	public java.lang.String getUserName () {
		return userName;
	}

	/**
	 * Set the value related to the column: user_name
	 * @param userName the user_name value
	 */
	public void setUserName (java.lang.String userName) {
		this.userName = userName;
	}



	/**
	 * Return the value associated with the column: nick_name
	 */
	public java.lang.String getNickName () {
		return nickName;
	}

	/**
	 * Set the value related to the column: nick_name
	 * @param nickName the nick_name value
	 */
	public void setNickName (java.lang.String nickName) {
		this.nickName = nickName;
	}



	/**
	 * Return the value associated with the column: user_id
	 */
	public java.lang.Integer getUserId () {
		return userId;
	}

	/**
	 * Set the value related to the column: user_id
	 * @param userId the user_id value
	 */
	public void setUserId (java.lang.Integer userId) {
		this.userId = userId;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.chee.plant.hibernate.object.ExternalUser)) return false;
		else {
			com.chee.plant.hibernate.object.ExternalUser externalUser = (com.chee.plant.hibernate.object.ExternalUser) obj;
			if (null == this.getId() || null == externalUser.getId()) return false;
			else return (this.getId().equals(externalUser.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}

private static final long serialVersionUID = 1L; 
}